//
// Created by ashCheng on 2022/9/9.
//
#include <iostream>

int main()
{
  int ival =  1024;
  int *pi = &ival;
  int **ppi = &pi;

  std::cout << "The value of ival\n"
            << "direct value: " << ival << "\n"
            << "indirect value: " << *pi << "\n"
            << "double indirect value: " << **ppi << "\n"
            << std::endl;

  const int v2 = 0;
  int v1 = 1;
  int *p1 = &v1, &r1 = v1;
  r1 = v2;

  std::cout << "v2:" << v2 << "\n"
            << "v1:" << v1 << "\n"
            << "*p1:" << *p1 << "\n"
            << "r1:" << r1 << "\n"
            << std::endl;
  return 0;
}